package com.cn.xiaonuo.tcrfinance.tcrorder.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cn.xiaonuo.tcrfinance.tcrorder.entity.PvBuySellOrder;
import com.cn.xiaonuo.tcrfinance.tcrorder.entity.PvOrder;
import com.cn.xiaonuo.tcrfinance.tcrshops.entity.PvOrderRequest;
import com.cn.xiaonuo.tcrfinance.tcrshops.vo.ExportPickingRecordsVo;
import com.cn.xiaonuo.tcrfinance.tcrusers.param.MasterAccountExcelParam;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface PvOrderMapper extends BaseMapper<PvOrder> {
    List<Map<String, Object>> queryHtProductList(@Param("pickProductIdList") List<String> pickProductIdList);

    //商品冻结数量加或者减
    Integer updatePByUIdAndPid(@Param("productId") Integer productId,
                                              @Param("delistingUserId") Integer delistingUserId,
                                              @Param("delistingNumber") Integer delistingNumber,
                                              @Param("type") Integer type
    );
    //插入商品数量变化日志，type=1为上票
    Integer insertProductLogByUserId(@Param("userId") Integer userId,
                                     @Param("orderId") Integer orderId,
                                     @Param("entrustOrderId") Integer entrustOrderId,
                                     @Param("goodsId") Integer goodsId,
                                     @Param("productId") Integer productId,
                                     @Param("productName") String productName,
                                     @Param("remark") String remark,
                                     @Param("createTime") String createTime,
                                     @Param("delistingNumber") Integer delistingNumber,
                                     @Param("type") Integer type
    );

    List<Map<String, Object>> selectPickUpOrder(PvOrderRequest pvOrderRequest);

    /**
     * 促销活动单
     * @param pvBuySellOrder
     * @return
     */
    List<Map<String, Object>> activitiesList(PvBuySellOrder pvBuySellOrder);

    int collectCashUpdate(PvOrder order);

    int collectCashUpdateNotState(PvOrder order);

    List<ExportPickingRecordsVo> exportPickingRecords(MasterAccountExcelParam param);
}
